#include <iostream>
#include <algorithm> //std::max
using namespace std;

float planB(int hours, int sales, int cost)
{ 
  float sum = 0;
  sum = 7 * hours + 0.1 * cost * sales;
  return sum;
}

float planC(int sales, int cost)
{
  float sum = 0;
  sum = 20 * sales + 0.2 * cost * sales;
  return sum;
}

int main(void)
{
    float hours = 0;
    float sales = 0;
    float cost = 225;
    
    cout << "your expected working hours/week: ";
    cin >> hours;
    cout << "your expected sales/week: ";
    cin >> sales;
    
    float A = 600;
    float B = planB(hours, sales, cost);
    float C = planC(sales, cost);
    float best = max(max(A, B), C);
    
    if (A == best)
      cout << "\nyour best choice is plan A.\n"
        << "compensation is " << A << " dollars" << endl;
    if (B == best)
      cout << "\nyour best choice is plan B.\n"
        << "compensation is " << B << " dollars" << endl;
    if (C == best)
      cout << "\nyour best choice is plan C.\n"
        << "compensation is " << C << " dollars" << endl;  
}
